import 'package:flutter/cupertino.dart';

class Unit {
  ///android原生dp转flutter单位
  static double androidToFlutter(BuildContext context, double androidDp) {
    double devicePixelRatio = MediaQuery.of(context).devicePixelRatio;
    double widthInLogicalPixels = androidDp * devicePixelRatio / 160.0;
    return widthInLogicalPixels + androidDp;
  }
}
